package com.songVersion.model;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable
public class Song
{
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;

	@Persistent
	private String title;
	@Persistent
	private String author;
	@Persistent
	private boolean youtubeLinked;

	@Persistent
	private YoutubeInfo youtubeInfo;

	// private Track track;

	public Song(String title, String author)
	{
		super();
		this.title = title;
		this.author = author;
		this.youtubeLinked = false;
	}

	public Song(Song s)
	{
		this.key = s.getKey();
		this.title = s.getTitle();
		this.author = s.getAuthor();
		this.youtubeLinked = s.isYoutubeLinked();
		this.youtubeInfo = new YoutubeInfo(s.getYoutubeInfo());
	}

	public String getTitle()
	{
		return title;
	}

	public void setTitle(String title)
	{
		this.title = title;
	}

	public String getAuthor()
	{
		return author;
	}

	public void setAuthor(String author)
	{
		this.author = author;
	}

	public boolean isYoutubeLinked()
	{
		return youtubeLinked;
	}

	public void setYoutubeLinked(boolean youtubeLinked)
	{
		this.youtubeLinked = youtubeLinked;
	}

	public YoutubeInfo getYoutubeInfo()
	{
		return youtubeInfo;
	}

	public void setYoutubeInfo(YoutubeInfo youtubeInfo)
	{
		this.youtubeInfo = youtubeInfo;
	}

	public Key getKey()
	{
		return key;
	}

	public void setKey(Key key)
	{
		this.key = key;
	}

}
